using UnityEngine;

namespace Scanline.GUI
{
    public class Point : MonoBehaviour
    {
        private Board board;
        public Vector2Int boardPosition;
        public Vector3 aligned;

        private void OnDrawGizmos()
        {
            if (board == null)
                board = Board.FindInstance();
            else
            {
                boardPosition = board.WorldToBoard(transform.position);
                aligned = board.BoardToWorld(boardPosition) + Vector3.back;
                Gizmos.color = new Color(1f, 0f, 0f, 0.2f);
                Gizmos.DrawCube(aligned, Vector3.one);
            }
        }
    }
}